]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
modalDialog: Inherit from St.Widget
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 23 May 2019 20:45:44 +0000 (15:45 -0500)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 24 May 2019 21:27:25 +0000 (16:27 -0500)
Make the dialog a widget itself, removing the `_group` property used for
handling the actor.

Update all the inherited classes to be also GObject implementations, moving all
the signals to proper object ones.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/55

14 files changed:
js/ui/accessDialog.js
js/ui/audioDeviceSelection.js
js/ui/components/keyring.js
js/ui/components/networkAgent.js
js/ui/components/polkitAgent.js
js/ui/endSessionDialog.js
js/ui/extensionDownloader.js
js/ui/main.js
js/ui/modalDialog.js
js/ui/runDialog.js
js/ui/shellMountOperation.js
js/ui/status/location.js
js/ui/status/network.js
js/ui/windowManager.js

index 69ba42c8d784da7d2ba180194ef543216726bd98..6f9b7f9a029eed340bb7d09741cc1e36a66e0101 100644 (file)
@@ -1,4 +1,4 @@
-const { Clutter, Gio, GLib, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
 
 const CheckBox = imports.ui.checkBox;
 const Dialog = imports.ui.dialog;
@@ -15,9 +15,10 @@ var DialogResponse = {
     CLOSED: 2
 };
 
-var AccessDialog = class extends ModalDialog.ModalDialog {
-    constructor(invocation, handle, title, subtitle, body, options) {
-        super({ styleClass: 'access-dialog' });
+var AccessDialog = GObject.registerClass(
+class AccessDialog extends ModalDialog.ModalDialog {
+    _init(invocation, handle, title, subtitle, body, options) {
+        super._init({ styleClass: 'access-dialog' });
 
         this._invocation = invocation;
         this._handle = handle;
@@ -109,7 +110,7 @@ var AccessDialog = class extends ModalDialog.ModalDialog {
         });
         this.close();
     }
-};
+});
 
 var AccessDialogDBus = class {
     constructor() {
index 25fde891fc4712a01a549a0940c56afad511deba..2a83b7fdb5fd467420398877cbac05d5a39ae4cd 100644 (file)
@@ -1,4 +1,4 @@
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 
 const Main = imports.ui.main;
 const ModalDialog = imports.ui.modalDialog;
@@ -13,10 +13,11 @@ var AudioDevice = {
 
 const AudioDeviceSelectionIface = loadInterfaceXML('org.gnome.Shell.AudioDeviceSelection');
 
-var AudioDeviceSelectionDialog =
-class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
-    constructor(devices) {
-        super({ styleClass: 'audio-device-selection-dialog' });
+var AudioDeviceSelectionDialog = GObject.registerClass({
+    Signals: { 'device-selected': { param_types: [GObject.TYPE_UINT] } }
+}, class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
+    _init(devices) {
+        super._init({ styleClass: 'audio-device-selection-dialog' });
 
         this._deviceItems = {};
 
@@ -33,10 +34,6 @@ class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
             throw new Error('Too few devices for a selection');
     }
 
-    destroy() {
-        super.destroy();
-    }
-
     _buildLayout(devices) {
         let title = new St.Label({ style_class: 'audio-selection-title',
                                    text: _("Select Audio Device"),
@@ -125,7 +122,7 @@ class AudioDeviceSelectionDialog extends ModalDialog.ModalDialog {
         Main.overview.hide();
         app.activate();
     }
-};
+});
 
 var AudioDeviceSelectionDBus = class AudioDeviceSelectionDBus {
     constructor() {
index ab0793f54f891ea9d2d68fd17f81c9ee1e194224..fccadca12984aabc8a30b3b95bd1297297f4feef 100644 (file)
@@ -10,9 +10,10 @@ const CheckBox = imports.ui.checkBox;
 
 var WORK_SPINNER_ICON_SIZE = 16;
 
-var KeyringDialog = class extends ModalDialog.ModalDialog {
-    constructor() {
-        super({ styleClass: 'prompt-dialog' });
+var KeyringDialog = GObject.registerClass(
+class KeyringDialog extends ModalDialog.ModalDialog {
+    _init() {
+        super._init({ styleClass: 'prompt-dialog' });
 
         this.prompt = new Shell.KeyringPrompt();
         this.prompt.connect('show-password', this._onShowPassword.bind(this));
@@ -212,7 +213,7 @@ var KeyringDialog = class extends ModalDialog.ModalDialog {
     _onCancelButton() {
         this.prompt.cancel();
     }
-};
+});
 
 var KeyringDummyDialog = class {
     constructor() {
index f871c732d907316dd6d43da6d9c5f6dc29cb3e75..48bbd308f552f89f5faecade32c2788e10ebcb35 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, NM, Pango, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, NM, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Config = imports.misc.config;
@@ -12,9 +12,10 @@ const ShellEntry = imports.ui.shellEntry;
 
 const VPN_UI_GROUP = 'VPN Plugin UI';
 
-var NetworkSecretDialog = class extends ModalDialog.ModalDialog {
-    constructor(agent, requestId, connection, settingName, hints, flags, contentOverride) {
-        super({ styleClass: 'prompt-dialog' });
+var NetworkSecretDialog = GObject.registerClass(
+class NetworkSecretDialog extends ModalDialog.ModalDialog {
+    _init(agent, requestId, connection, settingName, hints, flags, contentOverride) {
+        super._init({ styleClass: 'prompt-dialog' });
 
         this._agent = agent;
         this._requestId = requestId;
@@ -347,7 +348,7 @@ var NetworkSecretDialog = class extends ModalDialog.ModalDialog {
 
         return content;
     }
-};
+});
 
 var VPNRequestHandler = class {
     constructor(agent, requestId, authHelper, serviceType, connection, hints, flags) {
index 21feb40903aad012053e39257e783d9baf8ba756..27566531fa4b01b6ab2b5b9afa84cddf8a2f9fb2 100644 (file)
@@ -1,7 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
 const { AccountsService, Clutter, Gio, GLib,
-        Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
+        GObject, Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Animation = imports.ui.animation;
@@ -15,9 +15,11 @@ var DIALOG_ICON_SIZE = 48;
 
 var WORK_SPINNER_ICON_SIZE = 16;
 
-var AuthenticationDialog = class extends ModalDialog.ModalDialog {
-    constructor(actionId, body, cookie, userNames) {
-        super({ styleClass: 'prompt-dialog' });
+var AuthenticationDialog = GObject.registerClass({
+    Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } }
+}, class AuthenticationDialog extends ModalDialog.ModalDialog {
+    _init(actionId, body, cookie, userNames) {
+        super._init({ styleClass: 'prompt-dialog' });
 
         this.actionId = actionId;
         this.message = body;
@@ -25,7 +27,7 @@ var AuthenticationDialog = class extends ModalDialog.ModalDialog {
         this._wasDismissed = false;
 
         this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
-            this._group.visible = !Main.sessionMode.isLocked;
+            this.visible = !Main.sessionMode.isLocked;
         });
 
         this.connect('closed', this._onDialogClosed.bind(this));
@@ -326,8 +328,7 @@ var AuthenticationDialog = class extends ModalDialog.ModalDialog {
 
         this._destroySession();
     }
-};
-Signals.addSignalMethods(AuthenticationDialog.prototype);
+});
 
 var AuthenticationAgent = class {
     constructor() {
index 0d4aa9d4d154114e45f12223e06434e08b4727e9..d83578fb950caaf6420f47070ce1640dda5bd6f8 100644 (file)
@@ -19,7 +19,7 @@
 const Mainloop = imports.mainloop;
 
 const { AccountsService, Clutter, Gio,
-        GLib, Pango, Polkit, Shell, St }  = imports.gi;
+        GLib, GObject, Pango, Polkit, Shell, St }  = imports.gi;
 
 const CheckBox = imports.ui.checkBox;
 const GnomeSession = imports.misc.gnomeSession;
@@ -226,10 +226,11 @@ function init() {
     _endSessionDialog = new EndSessionDialog();
 }
 
-var EndSessionDialog = class EndSessionDialog extends ModalDialog.ModalDialog {
-    constructor() {
-        super({ styleClass: 'end-session-dialog',
-                destroyOnClose: false });
+var EndSessionDialog = GObject.registerClass(
+class EndSessionDialog extends ModalDialog.ModalDialog {
+    _init() {
+        super._init({ styleClass: 'end-session-dialog',
+                      destroyOnClose: false });
 
         this._loginManager = LoginManager.getLoginManager();
         this._userManager = AccountsService.UserManager.get_default();
@@ -747,4 +748,4 @@ var EndSessionDialog = class EndSessionDialog extends ModalDialog.ModalDialog {
     Close(parameters, invocation) {
         this.close();
     }
-};
+});
index 9aed29c693b653efab1c2853c2abccad9ca4a764..fdef0b9d20cfd14375fdd113a1b55dcab4ead057 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, Soup, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Soup, St } = imports.gi;
 
 const Config = imports.misc.config;
 const ExtensionUtils = imports.misc.extensionUtils;
@@ -176,10 +176,10 @@ function checkForUpdates() {
     });
 }
 
-var InstallExtensionDialog =
+var InstallExtensionDialog = GObject.registerClass(
 class InstallExtensionDialog extends ModalDialog.ModalDialog {
-    constructor(uuid, info, invocation) {
-        super({ styleClass: 'extension-dialog' });
+    _init(uuid, info, invocation) {
+        super._init({ styleClass: 'extension-dialog' });
 
         this._uuid = uuid;
         this._info = info;
@@ -255,7 +255,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
 
         this.close();
     }
-};
+});
 
 function init() {
     _httpSession = new Soup.SessionAsync({ ssl_use_system_ca_file: true });
index a6444a79a441d154e3bb2f2b3ab73d9436e4fe24..d9f287cd9ded262a38ac40ca5d362340b223023a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Mainloop = imports.mainloop;
 
 const AccessDialog = imports.ui.accessDialog;
@@ -689,12 +689,13 @@ function queueDeferredWork(workId) {
     }
 }
 
-var RestartMessage = class extends ModalDialog.ModalDialog {
-    constructor(message) {
-        super({ shellReactive: true,
-                styleClass: 'restart-message headline',
-                shouldFadeIn: false,
-                destroyOnClose: true });
+var RestartMessage = GObject.registerClass(
+class RestartMessage extends ModalDialog.ModalDialog {
+    _init(message) {
+        super._init({ shellReactive: true,
+                      styleClass: 'restart-message headline',
+                      shouldFadeIn: false,
+                      destroyOnClose: true });
 
         let label = new St.Label({ text: message });
 
@@ -704,7 +705,7 @@ var RestartMessage = class extends ModalDialog.ModalDialog {
                                         y_align: St.Align.MIDDLE });
         this.buttonLayout.hide();
     }
-};
+});
 
 function showRestartMessage(message) {
     let restartMessage = new RestartMessage(message);
index 0a7cd30be893a14ec3b25b60b2206240739408e2..06476059b7e2ef5e793da82eae41f85c3caf205b 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Atk, Clutter, Shell, St } = imports.gi;
+const { Atk, Clutter, GObject, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Dialog = imports.ui.dialog;
@@ -21,8 +21,15 @@ var State = {
     FADED_OUT: 4
 };
 
-var ModalDialog = class {
-    constructor(params) {
+var ModalDialog = GObject.registerClass({
+    Signals: { 'opened': {}, 'closed': {} }
+}, class ModalDialog extends St.Widget {
+    _init(params) {
+        super._init({ visible: false,
+                      x: 0,
+                      y: 0,
+                      accessible_role: Atk.Role.DIALOG });
+
         params = Params.parse(params, { shellReactive: false,
                                         styleClass: null,
                                         actionMode: Shell.ActionMode.SYSTEM_MODAL,
@@ -38,31 +45,25 @@ var ModalDialog = class {
         this._shouldFadeOut = params.shouldFadeOut;
         this._destroyOnClose = params.destroyOnClose;
 
-        this._group = new St.Widget({ visible: false,
-                                      x: 0,
-                                      y: 0,
-                                      accessible_role: Atk.Role.DIALOG });
-        Main.layoutManager.modalDialogGroup.add_actor(this._group);
+        Main.layoutManager.modalDialogGroup.add_actor(this);
 
         let constraint = new Clutter.BindConstraint({ source: global.stage,
                                                       coordinate: Clutter.BindCoordinate.ALL });
-        this._group.add_constraint(constraint);
-
-        this._group.connect('destroy', this._onGroupDestroy.bind(this));
+        this.add_constraint(constraint);
 
         this.backgroundStack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
         this._backgroundBin = new St.Bin({ child: this.backgroundStack,
                                            x_fill: true, y_fill: true });
         this._monitorConstraint = new Layout.MonitorConstraint();
         this._backgroundBin.add_constraint(this._monitorConstraint);
-        this._group.add_actor(this._backgroundBin);
+        this.add_actor(this._backgroundBin);
 
         this.dialogLayout = new Dialog.Dialog(this.backgroundStack, params.styleClass);
         this.contentLayout = this.dialogLayout.contentLayout;
         this.buttonLayout = this.dialogLayout.buttonLayout;
 
         if (!this._shellReactive) {
-            this._lightbox = new Lightbox.Lightbox(this._group,
+            this._lightbox = new Lightbox.Lightbox(this,
                                                    { inhibitEvents: true,
                                                      radialEffect: true });
             this._lightbox.highlight(this._backgroundBin);
@@ -77,10 +78,6 @@ var ModalDialog = class {
         this._savedKeyFocus = null;
     }
 
-    destroy() {
-        this._group.destroy();
-    }
-
     clearButtons() {
         this.dialogLayout.clearButtons();
     }
@@ -96,10 +93,6 @@ var ModalDialog = class {
         return this.dialogLayout.addButton(buttonInfo);
     }
 
-    _onGroupDestroy() {
-        this.emit('destroy');
-    }
-
     _fadeOpen(onPrimary) {
         if (onPrimary)
             this._monitorConstraint.primary = true;
@@ -111,9 +104,9 @@ var ModalDialog = class {
         this.dialogLayout.opacity = 255;
         if (this._lightbox)
             this._lightbox.show();
-        this._group.opacity = 0;
-        this._group.show();
-        Tweener.addTween(this._group,
+        this.opacity = 0;
+        this.show();
+        Tweener.addTween(this,
                          { opacity: 255,
                            time: this._shouldFadeIn ? OPEN_AND_CLOSE_TIME : 0,
                            transition: 'easeOutQuad',
@@ -149,7 +142,7 @@ var ModalDialog = class {
 
     _closeComplete() {
         this.state = State.CLOSED;
-        this._group.hide();
+        this.hide();
         this.emit('closed');
 
         if (this._destroyOnClose)
@@ -165,7 +158,7 @@ var ModalDialog = class {
         this._savedKeyFocus = null;
 
         if (this._shouldFadeOut)
-            Tweener.addTween(this._group,
+            Tweener.addTween(this,
                              { opacity: 0,
                                time: OPEN_AND_CLOSE_TIME,
                                transition: 'easeOutQuad',
@@ -183,11 +176,11 @@ var ModalDialog = class {
             return;
 
         let focus = global.stage.key_focus;
-        if (focus && this._group.contains(focus))
+        if (focus && this.contains(focus))
             this._savedKeyFocus = focus;
         else
             this._savedKeyFocus = null;
-        Main.popModal(this._group, timestamp);
+        Main.popModal(this, timestamp);
         this._hasModal = false;
 
         if (!this._shellReactive)
@@ -201,7 +194,7 @@ var ModalDialog = class {
         let params = { actionMode: this._actionMode };
         if (timestamp)
             params['timestamp'] = timestamp;
-        if (!Main.pushModal(this._group, params))
+        if (!Main.pushModal(this, params))
             return false;
 
         this._hasModal = true;
@@ -246,5 +239,4 @@ var ModalDialog = class {
                            }
                          });
     }
-};
-Signals.addSignalMethods(ModalDialog.prototype);
+});
index 49f14026f6bc61a1f3cc8ee1f17a78eb9131f90e..a4ac8c82b3c8126006eb58751332128d14eca4a1 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Main = imports.ui.main;
@@ -23,10 +23,11 @@ const EXEC_ARG_KEY = 'exec-arg';
 
 var DIALOG_GROW_TIME = 0.1;
 
-var RunDialog = class extends ModalDialog.ModalDialog {
-    constructor() {
-        super({ styleClass: 'run-dialog',
-                destroyOnClose: false });
+var RunDialog = GObject.registerClass(
+class RunDialog extends ModalDialog.ModalDialog {
+    _init() {
+        super._init({ styleClass: 'run-dialog',
+                      destroyOnClose: false });
 
         this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
         this._terminalSettings = new Gio.Settings({ schema_id: TERMINAL_SCHEMA });
@@ -282,5 +283,4 @@ var RunDialog = class extends ModalDialog.ModalDialog {
 
         super.open();
     }
-};
-Signals.addSignalMethods(RunDialog.prototype);
+});
index 1311b451a8a05e71c136573a4d224f62b6b4212f..8cb690b6e0727579e8b3bf8043e8dc5aaba2d845 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, Pango, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Pango, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
 const Animation = imports.ui.animation;
@@ -269,9 +269,11 @@ var ShellUnmountNotifier = class extends MessageTray.Source {
     }
 };
 
-var ShellMountQuestionDialog = class extends ModalDialog.ModalDialog {
-    constructor(icon) {
-        super({ styleClass: 'mount-dialog' });
+var ShellMountQuestionDialog = GObject.registerClass({
+    Signals: { 'response': { param_types: [GObject.TYPE_INT] } }
+}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
+    _init(icon) {
+        super._init({ styleClass: 'mount-dialog' });
 
         this._content = new Dialog.MessageDialogContent({ icon });
         this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
@@ -281,15 +283,21 @@ var ShellMountQuestionDialog = class extends ModalDialog.ModalDialog {
         _setLabelsForMessage(this._content, message);
         _setButtonsForChoices(this, choices);
     }
-};
-Signals.addSignalMethods(ShellMountQuestionDialog.prototype);
-
-var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
-    constructor(message, icon, flags) {
+});
+
+var ShellMountPasswordDialog = GObject.registerClass({
+    Signals: { 'response': { param_types: [GObject.TYPE_INT,
+                                           GObject.TYPE_STRING,
+                                           GObject.TYPE_BOOLEAN,
+                                           GObject.TYPE_BOOLEAN,
+                                           GObject.TYPE_BOOLEAN,
+                                           GObject.TYPE_UINT] } }
+}, class ShellMountPasswordDialog extends ModalDialog.ModalDialog {
+    _init(message, icon, flags) {
         let strings = message.split('\n');
         let title = strings.shift() || null;
         let body = strings.shift() || null;
-        super({ styleClass: 'prompt-dialog' });
+        super._init({ styleClass: 'prompt-dialog' });
 
         let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
 
@@ -422,7 +430,7 @@ var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
     }
 
     _onCancelButton() {
-        this.emit('response', -1, '', false);
+        this.emit('response', -1, '', false, false, false, 0);
     }
 
     _onUnlockButton() {
@@ -453,7 +461,7 @@ var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
             this._hiddenVolume.actor.checked,
             this._systemVolume &&
             this._systemVolume.actor.checked,
-            pim);
+            parseInt(pim));
     }
 
     _onKeyfilesCheckboxClicked() {
@@ -485,11 +493,13 @@ var ShellMountPasswordDialog = class extends ModalDialog.ModalDialog {
             );
         this._onCancelButton();
     }
-};
+});
 
-var ShellProcessesDialog = class extends ModalDialog.ModalDialog {
-    constructor(icon) {
-        super({ styleClass: 'mount-dialog' });
+var ShellProcessesDialog = GObject.registerClass({
+    Signals: { 'response': { param_types: [GObject.TYPE_INT] } }
+}, class ShellProcessesDialog extends ModalDialog.ModalDialog {
+    _init(icon) {
+        super._init({ styleClass: 'mount-dialog' });
 
         this._content = new Dialog.MessageDialogContent({ icon });
         this.contentLayout.add(this._content, { x_fill: true, y_fill: false });
@@ -542,8 +552,7 @@ var ShellProcessesDialog = class extends ModalDialog.ModalDialog {
         _setLabelsForMessage(this._content, message);
         _setButtonsForChoices(this, choices);
     }
-};
-Signals.addSignalMethods(ShellProcessesDialog.prototype);
+});
 
 const GnomeShellMountOpIface = loadInterfaceXML('org.Gtk.MountOperationHandler');
 
@@ -659,7 +668,7 @@ var GnomeShellMountOpHandler = class {
                     details['password'] = GLib.Variant.new('s', password);
                     details['hidden_volume'] = GLib.Variant.new('b', hiddenVolume);
                     details['system_volume'] = GLib.Variant.new('b', systemVolume);
-                    details['pim'] = GLib.Variant.new('u', parseInt(pim));
+                    details['pim'] = GLib.Variant.new('u', pim);
                 }
 
                 this._clearCurrentRequest(response, details);
index e565367bbb49e3546b3169dbdac0a0ec072b51d8..7dc3b81f6cdc6bf027caa3bcd09f80d6031a52ce 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { Clutter, Gio, GLib, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
 
 const Dialog = imports.ui.dialog;
 const Main = imports.ui.main;
@@ -342,9 +342,11 @@ var AppAuthorizer = class {
     }
 };
 
-var GeolocationDialog = class extends ModalDialog.ModalDialog {
-    constructor(name, subtitle, reqAccuracyLevel) {
-        super({ styleClass: 'geolocation-dialog' });
+var GeolocationDialog = GObject.registerClass({
+    Signals: { 'response': { param_types: [GObject.TYPE_UINT] } }
+}, class GeolocationDialog extends ModalDialog.ModalDialog {
+    _init(name, subtitle, reqAccuracyLevel) {
+        super._init({ styleClass: 'geolocation-dialog' });
         this.reqAccuracyLevel = reqAccuracyLevel;
 
         let icon = new Gio.ThemedIcon({ name: 'find-location-symbolic' });
@@ -375,5 +377,4 @@ var GeolocationDialog = class extends ModalDialog.ModalDialog {
         this.emit('response', GeoclueAccuracyLevel.NONE);
         this.close();
     }
-};
-Signals.addSignalMethods(GeolocationDialog.prototype);
+});
index 20a6317a5fd4c21c97aab348142c92a8da1afcef..4ab82e9f298b81c47e1645414be605423c224e2f 100644 (file)
@@ -676,9 +676,10 @@ var NMWirelessDialogItem = GObject.registerClass({
     }
 });
 
-var NMWirelessDialog = class extends ModalDialog.ModalDialog {
-    constructor(client, device) {
-        super({ styleClass: 'nm-dialog' });
+var NMWirelessDialog = GObject.registerClass(
+class NMWirelessDialog extends ModalDialog.ModalDialog {
+    _init(client, device) {
+        super._init({ styleClass: 'nm-dialog' });
 
         this._client = client;
         this._device = device;
@@ -724,9 +725,11 @@ var NMWirelessDialog = class extends ModalDialog.ModalDialog {
             Main.sessionMode.disconnect(id);
             this.close();
         });
+
+        this.connect('destroy', this._onDestroy.bind(this));
     }
 
-    destroy() {
+    _onDestroy() {
         if (this._apAddedId) {
             GObject.Object.prototype.disconnect.call(this._device, this._apAddedId);
             this._apAddedId = 0;
@@ -752,8 +755,6 @@ var NMWirelessDialog = class extends ModalDialog.ModalDialog {
             Mainloop.source_remove(this._scanTimeoutId);
             this._scanTimeoutId = 0;
         }
-
-        super.destroy();
     }
 
     _onScanTimeout() {
@@ -1144,7 +1145,7 @@ var NMWirelessDialog = class extends ModalDialog.ModalDialog {
                 this._itemBox.grab_key_focus();
         });
     }
-};
+});
 
 var NMDeviceWireless = class {
     constructor(client, device) {
index 599790677a287e8089efb9d1aa395a22c04da088..1ab99fcdd23a51cf1e30aaff42af35a89f5b6ddf 100644 (file)
@@ -40,9 +40,10 @@ const GSD_WACOM_OBJECT_PATH = '/org/gnome/SettingsDaemon/Wacom';
 const GsdWacomIface = loadInterfaceXML('org.gnome.SettingsDaemon.Wacom');
 const GsdWacomProxy = Gio.DBusProxy.makeProxyWrapper(GsdWacomIface);
 
-var DisplayChangeDialog = class extends ModalDialog.ModalDialog {
-    constructor(wm) {
-        super({ styleClass: 'prompt-dialog' });
+var DisplayChangeDialog = GObject.registerClass(
+class DisplayChangeDialog extends ModalDialog.ModalDialog {
+    _init(wm) {
+        super._init({ styleClass: 'prompt-dialog' });
 
         this._wm = wm;
 
@@ -111,7 +112,7 @@ var DisplayChangeDialog = class extends ModalDialog.ModalDialog {
         this._wm.complete_display_change(true);
         this.close();
     }
-};
+});
 
 var WindowDimmer = class {
     constructor(actor) {